-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXUI-2058: Add error message on staffUI #3778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite minor changes, but probably worth doing
takeUntil(this.unsubscribe$), | ||
tap((error) => { | ||
this.staffSelectError = !!error; | ||
this.staffSelectErrors = error ? { title: 'Staff error', description: error.errorDescription } : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use optional chaining on error?.errorDescription, or possibly a ternary:
error ? { title: 'Staff error', description: error.errorDescription ? error.errorDescription : "unknown error" } : null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added optional chaining and ternary
return this.staffDataAccessService.fetchSingleUserById(route.params.id).pipe( | ||
map((user) => StaffUser.from(user)) | ||
tap((user:StaffUser) => console.log('User:', user)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should commit this console.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, will remove
Jira link (if applicable)
https://tools.hmcts.net/jira/browse/EXUI-2058
Change description
Add error message on staffUI